package com.newthread.jdp.util;

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringHelper {
	private ClassPathXmlApplicationContext applicationContext;

	private static class SpringHelperHolder {
		private static SpringHelper instance = new SpringHelper();

	}

	public static SpringHelper getInstance() {
		return SpringHelperHolder.instance;
	}

	public Object getBean(String str) {
		applicationContext = new ClassPathXmlApplicationContext("beans.xml");
		return applicationContext.getBean(str);
	}
	public void destroyApplicationContext(){
		applicationContext.destroy();
	}
}
